<template>
  <div id="app">
    <shopDetail :headerData="headerData"></shopDetail>
    <shopHeader :headerData="headerData"></shopHeader>
    <TopNav></TopNav>
    <keep-alive exclude="shopCart">
      <router-view></router-view>
    </keep-alive>
  </div>
</template>

 <script>
//导入子组件
import shopHeader from "./views/shopHeader/shopHeader";
import TopNav from "./views/TopNav/TopNav";
import shopDetail from "./views/shopDetail/shopDetail";
import { headerData } from "./network/headerData";
export default {
  name: "app",
  data() {
    return {
      headerData: {}
    };
  },
  components: {
    shopHeader,
    TopNav,
    shopDetail
  },
  created() {
    headerData().then(res => {
      this.headerData = res.data;
    });
  }
};
</script>
 
<style>
body,
html {
  font-size: 12px;
  font-weight: 200;
}
</style>
